from google.appengine.ext import webapp
from google.appengine.api import users
from google.appengine.ext.webapp import template
from DataClass.WebsiteRec import WebsiteRec
from DataClass.SiteUser import SiteUser
from DataClass.FullPage import FullPage

class TestDataSetup(object):
    def Setup(cls, user):
        luser = SiteUser.ForceAndGetSiteUserFromEmail(user.email())
        lwebsite = WebsiteRec.ForceAndGetWebsiteBySiteName(user.email(), "localhost", "localhost:8080")
        
        if not FullPage.GetPageBySiteNameAndPageName("main", "localhost"):
            page = FullPage()
            page.pagename = "main"
            page.sitename = "localhost"
            page.authoremail = "emlynoregan@gmail.com"
            page.contenttext = """
<html>
<head>
   <title>Main Page</title>
</head>
<body>
   Main Page
</body>
</html>        
        """
            page.put()
            
    Setup = classmethod(Setup)
